#ifndef MUTEX_H_INCLUDED
#define MUTEX_H_INCLUDED
#include <SDL.H>


class Mutex
{
public:
	Mutex()
	{
		m_mtx = SDL_CreateMutex();
	}

	~Mutex()
	{
		SDL_DestroyMutex(m_mtx);
	}

	void Lock()
	{
		SDL_LockMutex(m_mtx);
	}

	void UnLock()
	{
		SDL_UnlockMutex(m_mtx);
	}

private:
	SDL_mutex* m_mtx;
};

class MutexLocker
{
public:
	MutexLocker(Mutex* ml)
	{
		m_mtx = ml;
		m_mtx->Lock();
		
	}

	~MutexLocker()
	{
		m_mtx->UnLock();
	}

private:
	Mutex* m_mtx;

};


#endif